﻿using System;
using System.Collections.Generic;
using System.Text;
using ContentRenderingApi.Extender;
using ContentRenderingApi.Path;

namespace ContentRenderingApi.Skeleton
{
    /// <summary/>
    internal class ChildSortSkeleton 
    {
        private AbstractPath _path;
        private Func<object[], object[], int> _childSortCallback;
        private NameTypeExtender[] _nameTypeExtenders;

        /// <summary/>
        internal ChildSortSkeleton(
            AbstractPath path,
            Func<object[], object[], int> childSortCallback,
            NameTypeExtender[] nameTypeExtenders)
        {
            this._path = path;
            this._childSortCallback = childSortCallback;
            this._nameTypeExtenders = nameTypeExtenders;
        }

        /// <summary/>
        public int Compare(object[] valuesOne, object[] valuesTwo)
        {
            return this._childSortCallback(valuesOne, valuesTwo);
        }

        /// <summary/>
        public AbstractPath Path
        {
            get { return this._path; }
        }

        /// <summary/>
        public NameTypeExtender[] NameTypeExtenders
        {
            get { return this._nameTypeExtenders; }
        }
    }
}
